//Form thừa kế dành cho phần danh mục
//Cho phép nhập dữ liệu trên lưới
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using Infragistics.Win.UltraWinGrid;

namespace QLNHK
{
    /// <summary>
    /// Summary description for Frm_Base.
    /// </summary>
    public class FrmBase_DM : FrmBase
    {
        protected System.Windows.Forms.Panel panel1;
        public Infragistics.Win.Misc.UltraGridBagLayoutManager ultraGridBagLayoutManager1;
        protected Infragistics.Win.UltraWinGrid.UltraGrid UGMain;
        protected Infragistics.Win.Misc.UltraButton btnInsert;
        protected Infragistics.Win.Misc.UltraButton btnEdit;
        protected Infragistics.Win.Misc.UltraButton btnUpdate;
        protected Infragistics.Win.Misc.UltraButton btnDelete;
        protected Infragistics.Win.Misc.UltraButton btnCancel;
        protected Infragistics.Win.Misc.UltraButton btnExit;
        private System.ComponentModel.IContainer components;

        public bool IsChange;
        private Infragistics.Win.Misc.UltraLabel ultraLabel1;
        public string caption;

        public FrmBase_DM()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmBase_DM));
            Infragistics.Win.Appearance appearance8 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance9 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance10 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance11 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance12 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance13 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance14 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance1 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance2 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance3 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance4 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance5 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance6 = new Infragistics.Win.Appearance();
            Infragistics.Win.Appearance appearance7 = new Infragistics.Win.Appearance();
            this.ultraGridBagLayoutManager1 = new Infragistics.Win.Misc.UltraGridBagLayoutManager(this.components);
            this.UGMain = new Infragistics.Win.UltraWinGrid.UltraGrid();
            this.panel1 = new System.Windows.Forms.Panel();
            this.btnInsert = new Infragistics.Win.Misc.UltraButton();
            this.btnEdit = new Infragistics.Win.Misc.UltraButton();
            this.btnUpdate = new Infragistics.Win.Misc.UltraButton();
            this.btnDelete = new Infragistics.Win.Misc.UltraButton();
            this.btnCancel = new Infragistics.Win.Misc.UltraButton();
            this.btnExit = new Infragistics.Win.Misc.UltraButton();
            this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
            ((System.ComponentModel.ISupportInitialize)(this.ultraGridBagLayoutManager1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(this.UGMain)).BeginInit();
            this.panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // imgList
            // 
            this.imgList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgList.ImageStream")));
            this.imgList.Images.SetKeyName(0, "");
            this.imgList.Images.SetKeyName(1, "");
            this.imgList.Images.SetKeyName(2, "");
            this.imgList.Images.SetKeyName(3, "");
            this.imgList.Images.SetKeyName(4, "");
            this.imgList.Images.SetKeyName(5, "");
            this.imgList.Images.SetKeyName(6, "");
            this.imgList.Images.SetKeyName(7, "");
            this.imgList.Images.SetKeyName(8, "");
            this.imgList.Images.SetKeyName(9, "");
            this.imgList.Images.SetKeyName(10, "");
            this.imgList.Images.SetKeyName(11, "");
            this.imgList.Images.SetKeyName(12, "");
            this.imgList.Images.SetKeyName(13, "");
            // 
            // ultraGridBagLayoutManager1
            // 
            this.ultraGridBagLayoutManager1.ContainerControl = this.panel1;
            // 
            // UGMain
            // 
            appearance8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(234)))), ((int)(((byte)(253)))));
            appearance8.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(151)))), ((int)(((byte)(253)))));
            appearance8.BackGradientStyle = Infragistics.Win.GradientStyle.ForwardDiagonal;
            this.UGMain.DisplayLayout.Appearance = appearance8;
            this.UGMain.DisplayLayout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.ResizeAllColumns;
            appearance9.FontData.BoldAsString = "True";
            appearance9.TextHAlignAsString = "Left";
            appearance9.TextVAlignAsString = "Middle";
            this.UGMain.DisplayLayout.CaptionAppearance = appearance9;
            this.UGMain.DisplayLayout.CaptionVisible = Infragistics.Win.DefaultableBoolean.True;
            this.UGMain.DisplayLayout.InterBandSpacing = 10;
            this.UGMain.DisplayLayout.Override.AllowDelete = Infragistics.Win.DefaultableBoolean.False;
            this.UGMain.DisplayLayout.Override.AllowGroupBy = Infragistics.Win.DefaultableBoolean.False;
            this.UGMain.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True;
            appearance10.BackColor = System.Drawing.Color.Transparent;
            this.UGMain.DisplayLayout.Override.CardAreaAppearance = appearance10;
            this.UGMain.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.Edit;
            appearance11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(234)))), ((int)(((byte)(253)))));
            appearance11.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(151)))), ((int)(((byte)(253)))));
            appearance11.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
            appearance11.FontData.BoldAsString = "False";
            appearance11.FontData.Name = "Tahoma";
            appearance11.FontData.SizeInPoints = 8F;
            appearance11.ForeColor = System.Drawing.Color.Black;
            appearance11.ThemedElementAlpha = Infragistics.Win.Alpha.Transparent;
            this.UGMain.DisplayLayout.Override.HeaderAppearance = appearance11;
            this.UGMain.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
            appearance12.BorderColor = System.Drawing.Color.DodgerBlue;
            this.UGMain.DisplayLayout.Override.RowAppearance = appearance12;
            appearance13.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(234)))), ((int)(((byte)(253)))));
            appearance13.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(151)))), ((int)(((byte)(253)))));
            appearance13.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
            this.UGMain.DisplayLayout.Override.RowSelectorAppearance = appearance13;
            this.UGMain.DisplayLayout.Override.RowSelectorHeaderStyle = Infragistics.Win.UltraWinGrid.RowSelectorHeaderStyle.SeparateElement;
            this.UGMain.DisplayLayout.Override.RowSelectorNumberStyle = Infragistics.Win.UltraWinGrid.RowSelectorNumberStyle.VisibleIndex;
            this.UGMain.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.True;
            this.UGMain.DisplayLayout.Override.RowSpacingBefore = 0;
            appearance14.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(181)))), ((int)(((byte)(234)))), ((int)(((byte)(253)))));
            appearance14.BackColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(151)))), ((int)(((byte)(253)))));
            appearance14.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
            appearance14.ForeColor = System.Drawing.Color.Black;
            this.UGMain.DisplayLayout.Override.SelectedRowAppearance = appearance14;
            this.UGMain.DisplayLayout.RowConnectorColor = System.Drawing.Color.FromArgb(((int)(((byte)(33)))), ((int)(((byte)(151)))), ((int)(((byte)(253)))));
            this.UGMain.DisplayLayout.RowConnectorStyle = Infragistics.Win.UltraWinGrid.RowConnectorStyle.None;
            this.UGMain.Dock = System.Windows.Forms.DockStyle.Fill;
            this.UGMain.Location = new System.Drawing.Point(0, 0);
            this.UGMain.Name = "UGMain";
            this.UGMain.Size = new System.Drawing.Size(560, 270);
            this.UGMain.TabIndex = 38;
            // 
            // panel1
            // 
            this.panel1.BackColor = System.Drawing.Color.White;
            this.panel1.Controls.Add(this.btnInsert);
            this.panel1.Controls.Add(this.btnEdit);
            this.panel1.Controls.Add(this.btnUpdate);
            this.panel1.Controls.Add(this.btnDelete);
            this.panel1.Controls.Add(this.btnCancel);
            this.panel1.Controls.Add(this.btnExit);
            this.panel1.Controls.Add(this.ultraLabel1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel1.Location = new System.Drawing.Point(0, 270);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(560, 32);
            this.panel1.TabIndex = 7;
            // 
            // btnInsert
            // 
            appearance1.Image = ((object)(resources.GetObject("appearance1.Image")));
            this.btnInsert.Appearance = appearance1;
            this.btnInsert.BackColorInternal = System.Drawing.SystemColors.Control;
            this.btnInsert.Location = new System.Drawing.Point(10, 4);
            this.btnInsert.Name = "btnInsert";
            this.btnInsert.Size = new System.Drawing.Size(94, 24);
            this.btnInsert.TabIndex = 16;
            this.btnInsert.Text = "&Thêm";
            // 
            // btnEdit
            // 
            appearance2.Image = ((object)(resources.GetObject("appearance2.Image")));
            this.btnEdit.Appearance = appearance2;
            this.btnEdit.BackColorInternal = System.Drawing.SystemColors.Control;
            this.btnEdit.Location = new System.Drawing.Point(104, 4);
            this.btnEdit.Name = "btnEdit";
            this.btnEdit.Size = new System.Drawing.Size(90, 24);
            this.btnEdit.TabIndex = 15;
            this.btnEdit.Text = "&Sửa";
            // 
            // btnUpdate
            // 
            appearance3.Image = ((object)(resources.GetObject("appearance3.Image")));
            this.btnUpdate.Appearance = appearance3;
            this.btnUpdate.BackColorInternal = System.Drawing.SystemColors.Control;
            this.btnUpdate.Enabled = false;
            this.btnUpdate.Location = new System.Drawing.Point(194, 4);
            this.btnUpdate.Name = "btnUpdate";
            this.btnUpdate.Size = new System.Drawing.Size(92, 24);
            this.btnUpdate.TabIndex = 10;
            this.btnUpdate.Text = "&Lưu";
            // 
            // btnDelete
            // 
            appearance4.Image = ((object)(resources.GetObject("appearance4.Image")));
            this.btnDelete.Appearance = appearance4;
            this.btnDelete.BackColorInternal = System.Drawing.SystemColors.Control;
            this.btnDelete.Location = new System.Drawing.Point(286, 4);
            this.btnDelete.Name = "btnDelete";
            this.btnDelete.Size = new System.Drawing.Size(86, 24);
            this.btnDelete.TabIndex = 8;
            this.btnDelete.Text = "&Xóa";
            // 
            // btnCancel
            // 
            appearance5.Image = ((object)(resources.GetObject("appearance5.Image")));
            this.btnCancel.Appearance = appearance5;
            this.btnCancel.BackColorInternal = System.Drawing.SystemColors.Control;
            this.btnCancel.Enabled = false;
            this.btnCancel.Location = new System.Drawing.Point(372, 4);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new System.Drawing.Size(88, 24);
            this.btnCancel.TabIndex = 5;
            this.btnCancel.Text = "&Bỏ qua";
            // 
            // btnExit
            // 
            appearance6.Image = ((object)(resources.GetObject("appearance6.Image")));
            this.btnExit.Appearance = appearance6;
            this.btnExit.BackColorInternal = System.Drawing.SystemColors.Control;
            this.btnExit.Location = new System.Drawing.Point(460, 4);
            this.btnExit.Name = "btnExit";
            this.btnExit.Size = new System.Drawing.Size(90, 24);
            this.btnExit.TabIndex = 4;
            this.btnExit.Text = "Đó&ng";
            this.btnExit.Click += new System.EventHandler(this.btnExit_Click);
            // 
            // ultraLabel1
            // 
            appearance7.BackColor = System.Drawing.Color.White;
            appearance7.BackColor2 = System.Drawing.Color.Gainsboro;
            appearance7.BackGradientStyle = Infragistics.Win.GradientStyle.Vertical;
            this.ultraLabel1.Appearance = appearance7;
            this.ultraLabel1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.ultraLabel1.Location = new System.Drawing.Point(0, 0);
            this.ultraLabel1.Name = "ultraLabel1";
            this.ultraLabel1.Size = new System.Drawing.Size(560, 32);
            this.ultraLabel1.TabIndex = 17;
            // 
            // FrmBase_DM
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
            this.ClientSize = new System.Drawing.Size(560, 302);
            this.Controls.Add(this.UGMain);
            this.Controls.Add(this.panel1);
            this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Name = "FrmBase_DM";
            this.Text = "FrmBase_DM";
            ((System.ComponentModel.ISupportInitialize)(this.ultraGridBagLayoutManager1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(this.UGMain)).EndInit();
            this.panel1.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion

        protected void btnExit_Click(object sender, System.EventArgs e)
        {
            this.Close();
            this.Dispose();
        }

        protected void setChanged(bool trangthai)
        {
            if (trangthai)
            {
                this.IsChange = true;
                this.Text = this.caption + "*";
            }
            else
            {
                this.IsChange = false;
                this.Text = this.caption;
            }
            btnUpdate.Enabled = trangthai;
            btnCancel.Enabled = trangthai;
        }
    }
}
